//
//  Test2.m
//  SpeSmartUnitTester_Tests
//
//  Created by points on 2021/8/11.
//  Copyright © 2021 hfqf123. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HYXloginViewModel.h"
#import <HYXBaseHTTPRequestManagerModule/HYXBaseHTTPRequestManagerModule.h>
#import <YYModel/YYModel.h>
SPEC_BEGIN(LoingTest2)

describe(@"Test initial tests", ^{
    context(@"LoingTest", ^{
        
        it(@"can do maths", ^{
            
            __block NSString *_class = nil;
            [HYXHttpPushExtensionFactory factory].
            setPath(@"http://127.0.0.1:18080/unittest/autotest/path1")
            .setNeedToast(NO)
            .setResponseBlock(^(id<HYXHttpResponseModel> resp) {
                HYXHttpResonseModule *ret  = (HYXHttpResonseModule *)resp;
                HYXUnitTestNode  *root = [HYXUnitTestNode yy_modelWithJSON:ret.result];
                [root rebuildParentNode];
                if(ret.state.integerValue == 0){
                    HYXUnitTestNode *next = [HYXUnitTestNode getNextNode:root];
                    next.nextNodeBlock = ^(HYXUnitTestNode * _Nonnull unitTestNode) {
                        HYXUnitTestNode *currentNode = [HYXUnitTestNode getNextNode:unitTestNode];
                        NSLog(@"currentNode:%@",NSStringFromClass([currentNode class]));
                        if(currentNode){
                            _class = [currentNode class];
                        }else{
                            _class = [NSNull null];
                        }
                        
                    };
                    [next excuteNode];
                }else{

                }
            

            }).setErrorBock(^(id<HYXHttpFailModel> error) {

            }).post();
            
            [[expectFutureValue(_class) shouldEventuallyBeforeTimingOutAfter(10)] equal:[NSNull null]];
        });
    });
});

SPEC_END
